import request from "@/utils/request.js";

const Api = {
    captcha: "/v1/auth/captcha",
    login: "/v1/auth/login",
    logout: "/v1/auth/logout",
    userInfo: "/v1/auth/userInfo",
}

/**
 * 获取验证码
 */
export const captcha = (data) => {
    return request({
        url: Api.captcha,
        method: "GET",
        data,
    });
};

/**
 * 登录
 */
export const login = (data) => {
    return request({
        url: Api.login,
        method: "POST",
        data,
    });
};

/**
 * 注销
 */
export const logout = () => {
    return request({
        url: Api.logout,
        method: "POST",
    });
};

/**
 * 获取用户信息
 */
export const getUserInfo = () => {
    return request({
        url: Api.userInfo,
        method: "POST",
    });
};